﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Vds2465Telegrams
{
    [TestClass]
    public class ReportType_Technical_Test
    {
        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test01_Equals()
        {
            ReportType_Technical reportTypeTechnical = new ReportType_Technical(false, eReportSubType_Technical.Alarm);

            {
                // completely different type - NOT equal
                object dummyObject = new object();
                Assert.IsFalse(reportTypeTechnical.Equals(dummyObject));
            }

            {
                // same type - same property values
                ReportType_Technical reportTypeTechnical2compare = new ReportType_Technical(reportTypeTechnical.OnOffFlag, reportTypeTechnical.ReportSubType);
                Assert.IsTrue(reportTypeTechnical.Equals(reportTypeTechnical2compare));
            }

            {
                // same type - different OnOffFlag
                ReportType_Technical reportTypeTechnical2compare = new ReportType_Technical(!reportTypeTechnical.OnOffFlag, reportTypeTechnical.ReportSubType);
                Assert.IsFalse(reportTypeTechnical.Equals(reportTypeTechnical2compare));
            }

            {
                // same type - different ReportSubType
                eReportSubType_Technical reportSubTypeTechnical = eReportSubType_Technical.Emergency_1;
                if (reportTypeTechnical.ReportSubType == eReportSubType_Technical.Emergency_1)
                {
                    reportSubTypeTechnical = eReportSubType_Technical.Emergency_2;
                }
                ReportType_Technical reportTypeTechnical2compare = new ReportType_Technical(reportTypeTechnical.OnOffFlag, reportSubTypeTechnical);
                Assert.IsFalse(reportTypeTechnical.Equals(reportTypeTechnical2compare));
            }
        }

        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test02_GetHashCode()
        {
            ReportType_Technical reportTypeTechnical = new ReportType_Technical(false, eReportSubType_Technical.Emergency_3);
            int hashCode01 = reportTypeTechnical.GetHashCode();
        }

        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test03_ToString()
        {
            ReportType_Technical reportTypeTechnical = new ReportType_Technical(true, eReportSubType_Technical.Emergency_General);
            string stringResult = reportTypeTechnical.ToString();
            Assert.IsNotNull(stringResult);
        }
    }
}
